package com.kefu.call.vo;

import java.util.Date;
import org.apache.commons.lang3.StringUtils;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.kefu.common.vo.AbstractSearchVo;
import com.kefu.call.model.CdrSmhistory;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;

/**
 * @author CodeGenerator
 * @date 2022/07/26
 */
@Data
@EqualsAndHashCode(callSuper = true)
@ToString(callSuper = true)
@ApiModel(description = "计费_套餐扣除历史记录")
public class CdrSmhistorySearchVo extends AbstractSearchVo {

    @ApiModelProperty(value = "客户ID")
    private String company;
    @ApiModelProperty(value = "余额")
    private String yy;
    @ApiModelProperty(value = "扣除金额，租金")
    private String xykc;
    @ApiModelProperty(value = "扣除后金额")
    private String kchje;
    @ApiModelProperty(value = "扣除时间")
    private Date createtime;

	 @Override
    public  LambdaQueryWrapper<CdrSmhistory> lambdaQuery(){
    	LambdaQueryWrapper<CdrSmhistory> wrapper=Wrappers.<CdrSmhistory>lambdaQuery();
	    wrapper.eq(StringUtils.isNotBlank(company), CdrSmhistory::getCompany, company);//客户ID
	    wrapper.eq(StringUtils.isNotBlank(yy), CdrSmhistory::getYy, yy);//余额
	    wrapper.eq(StringUtils.isNotBlank(xykc), CdrSmhistory::getXykc, xykc);//扣除金额，租金
	    wrapper.eq(StringUtils.isNotBlank(kchje), CdrSmhistory::getKchje, kchje);//扣除后金额
		wrapper.eq(createtime!=null, CdrSmhistory::getCreatetime, createtime);//扣除时间
	    
    	return wrapper;
	}
}